package com.bms.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 权限
 * 
 * @author Lan
 */
@Entity
@Table(name = "T_PRIVILEGE")
public class Privilege extends BaseEntity {

	private static final long serialVersionUID = 4695118190625886541L;

	private String priviName;
	private String priviLink;
	private String description;
	private Privilege parentPrivi;

	/**
	 * @return 权限名称（展现于界面）
	 * @author Lan
	 */
	@Column(nullable = false, unique = true, length = 100)
	public String getPriviName() {
		return priviName;
	}

	/**
	 * @param priviName 权限名称
	 * @author Lan
	 */
	public void setPriviName(String priviName) {
		this.priviName = priviName;
	}
	
	@Column
	public String getPriviLink() {
		return priviLink;
	}

	public void setPriviLink(String priviLink) {
		this.priviLink = priviLink;
	}

	@Column(length = 200)
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "parentID")
	public Privilege getParentPrivi() {
		return parentPrivi;
	}

	public void setParentPrivi(Privilege parentPrivi) {
		this.parentPrivi = parentPrivi;
	}

}
